package tech.aistar.corejava.day06.extend;

/**
 * Created by 李雨昂 on 2019/7/22.
 */
public class Dog extends Animal{
    private double loyalty;

    public double getLoyalty() {
        return loyalty;
    }

    public void setLoyalty(double loyalty) {
        this.loyalty = loyalty;
    }

    public Dog() {
        super();
    }
    public Dog(String name,double loyalty){
        super(name);
        this.loyalty = loyalty;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Dog{");
        sb.append("loyalty=").append(loyalty);
        sb.append('}');
        return sb.toString();
    }

    public void spark(){
        System.out.println("汪汪...");
    }


}
